<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="./source/modules/icard/template/css/card.css?v={php echo $this->cur_version}" media="all">
    <script type="text/javascript" src="./source/modules/icard/template/js/accordian_pack.js"></script>
    <title>优惠券</title>
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
    <meta name="format-detection" content="telephone=no">
</head>
<body id="cardpower" ondragstart="return false;" onselectstart="return false;">
    {php include $this->template('wap_header');}
    <section class="body">
		<div id="basic-accordian">
            {php $index = 0;}
            {loop $coupons $coupon}
			<div id="test{$index}-header" class="accordion_headings {if $index==0}header_highlight{/if}">
				<div class="tab coupon">
					<span class="title">{$coupon['title']}<p>有效期至{php echo date('Y-m-d', $coupon['endtime']);}</p></span>
				</div>
				<div id="test{$index}-content" style="display: block; overflow: hidden; opacity: 1;">
					<div class="accordion_child">
						<p class="explain_sn" style="width: 70%;margin: 0px auto;color: #fff;">
                            {if TIMESTAMP < $coupon['starttime']}
                            <div style="height: 25px;line-height: 25px;font-size:14px;" class="disabled">未开始</div>
                            {else if TIMESTAMP > $coupon['endtime']}
                            <div style="height: 25px;line-height: 25px;font-size:14px;" class="disabled">已结束</div>
                            {else}
                                {if $coupon['count'] == 0}
                                <a style="height: 25px;line-height: 25px;font-size:14px;" class="submit" href="{php echo create_url('mobile/module', array('do' => 'wapmakesncode', 'from_user' => $page_from_user, 'name' => 'icard', 'weid' => $weid, 'type' => $type, 'id' => $coupon['id']))}">立即使用</a>
                                <p class="explain_sn">
                                <span style="font-size:12px;line-height:16px;text-align:left;padding:5px 0 5px 16px;">请点击上面的按钮使用或由商家扫描二维码</span>
                                {php echo $this->getQRImage('coupon_'.$coupon['id'],create_url('mobile/module', array('do' => 'wapmakesncodeadmin', 'from_user' => $page_from_user, 'name' => 'icard', 'weid' => $weid, 'type' => $type, 'id' => $coupon['id'])));}
                                </p>
                                {elseif $giftcount_arr[$coupon['id']] >= $coupon['count']}
                                <div style="height: 25px;line-height: 25px;font-size:14px;" class="disabled">已使用</div>
                                {else}
                                <a style="height: 25px;line-height: 25px;font-size:14px;" class="submit" href="{php echo create_url('mobile/module', array('do' => 'wapmakesncode', 'from_user' => $page_from_user, 'name' => 'icard', 'weid' => $weid, 'type' => $type, 'id' => $coupon['id']))}">立即使用</a>
                                <p class="explain_sn">
                                <span style="font-size:12px;line-height:16px;text-align:left;padding:5px 0 5px 16px;">请点击上面的按钮使用或由商家扫描二维码</span>
                                {php echo $this->getQRImage('coupon_'.$coupon['id'],create_url('mobile/module', array('do' => 'wapmakesncodeadmin', 'from_user' => $page_from_user, 'name' => 'icard', 'weid' => $weid, 'type' => $type, 'id' => $coupon['id'])));}
                                </p>
                                {/if}
                            {/if}
						</p>
						<b>详情说明</b>
						<ul>{php echo htmlspecialchars_decode($coupon['content']);}</ul>
					</div>
				</div>
			</div>
            {php $index++;}
            {/loop}
		</div>
		<div class="plugback">
			<a href="javascript:history.back(-1)">
				<div class="plugbg themeStyle">
				<span class="plugback"></span>
				</div>
			</a>
		</div>
        {php include $this->template('footer');}
<script>
window.onload = function(){
	new Accordian('basic-accordian',2,'header_highlight');
}
</script>
</section>

</body></html>